﻿@using SpyApp.Helpers;
@model SpyApp.Models.CustomPageList<SpyApp.Models.Message>
@{
    ViewBag.Title = "Message";
}

@{
    SpyApp.Models.CustomPageList<SpyApp.Models.Message> pageList = ViewBag.PageList;
}

<div class="page-header">
    <h3>
        <img src="~/Images/message-64.png" class="size-48"/>
        @ViewBag.Title
    </h3>
</div>

@*@{Html.RenderPartial("AddvanceSearchPartial", new SpyApp.Models.MessageModel.SearchCondition());}*@

<nav id="main-page-list-1">
    <script>
        document.getElementById("main-page-list-1").appendChild(
            getPageList(
            '@Model.PageCount',
            '@Model.PageIndex',
            '@SpyApp.Models.BaseCommon.Enum.StaticValue.CURRENT_PAGE'));
    </script>
</nav>

<div class="table-contain">
    <table class="max-width">
        <thead>
            <tr>
                <th>Type</th>
                <th>Program</th>
                <th>From/ To</th>
                <th>Content</th>
                <th>At</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.ListCustom == null)
            {
                <tr>
                    <td colspan="100%">
                        null
                    </td>
                </tr>
            }

            else{ foreach (var item in Model.ListCustom)
            {
                <tr>
                    <td data-type="@item.Type" title="@item.Type"></td>
                    <td data-type="@item.MessageType" title="@item.MessageType"></td>
                    <td>@item.NumberSendReceive</td>
                    <td>@item.UserMessage</td>
                    <td>@item.SendDateTime</td>
                </tr>
        }
        }
        </tbody>
    </table>
</div>

<nav id="main-page-list-2">
    <script>
        document.getElementById("main-page-list-2").appendChild(
            getPageList(
            '@Model.PageCount',
            '@Model.PageIndex',
            '@SpyApp.Models.BaseCommon.Enum.StaticValue.CURRENT_PAGE'));
    </script>
</nav>
